function ContextMenu(template){
	this.template = template; //template.cloneNode(true);
	this.template.style.position = "absolute";
	this.rows = new Array();
	
	return this;
}

// ------------------------------------------------------------------------------------------------

ContextMenu.prototype.Template = function(relativeElement, e){
	
	if (arguments.length>0){
//		this.template.style.left = relativeElement.scrollLeft + event.clientX;
//		this.template.style.top = event.clientY;
		
//		alert("XBrowserOffsetLeft: " + XBrowserOffsetLeft(relativeElement));
		
		this.template.style.left = XBrowserOffsetLeft(relativeElement) + XBrowserEventClientX(e) + "px";
		this.template.style.top = XBrowserEventClientY(e) + "px";
		
	}
	
	return this.template;
};

// ------------------------------------------------------------------------------------------------

ContextMenu.prototype.addRow = function(row){
	this.rows.push(row);
};